package com.otitan.la.forest.industry.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.otitan.la.forest.industry.dto.EnterpriseDTO;
import com.otitan.la.forest.industry.dto.EnterpriseEntityDTO;
import com.otitan.la.forest.industry.dto.EnterpriseStatisticalDTO;
import com.otitan.la.forest.industry.entity.EnterpriseEntity;
import com.otitan.webapp.framework.basepro.model.DataResult;
import org.springframework.validation.BindingResult;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 企业信息表
 *
 * @author jiacs
 * @email xxx
 * @date 2020-10-14 10:50:02
 */
public interface EnterpriseService extends IService<EnterpriseEntity> {

    /**
     * 新增
     *
     * @return
     */
    DataResult add(EnterpriseEntityDTO dto, BindingResult bindingResult);


    /**
     * 批量删除
     *
     * @return
     */
    DataResult batchDelete(List<String> ids);

    /**
     * 修改
     *
     * @return
     */
    DataResult editor(EnterpriseEntityDTO dto, BindingResult bindingResult);

    /**
     * 列表查询（分页）
     *
     * @return
     */
    DataResult findPageData(long page, long size, EnterpriseDTO enterprise);


    /**
     * 列表查询（分页）
     *
     * @return
     */
    DataResult findPageByCodes(long page, long size, EnterpriseDTO enterprise);

    /**
     * 根据ID查询
     *
     * @return
     */
    DataResult findOne(String id);


    DataResult<Map<String,Object>> statistical(EnterpriseStatisticalDTO enterpriseStatisticalDTO);



    /**
     * @return void
     * @throws [enterpriseEntity, httpServletResponse]
     * @Description:    导出
     * @Author:        wangqingsong
     * @CreateDate:     2020/10/16 8:50
     */
    void download(EnterpriseDTO enterpriseDTO, HttpServletResponse httpServletResponse);

    /**
    *  导入
    * @author Sunke
    * @param [httpServletResponse]
    * @return void
    * @exception
    * @date 2020/10/20 0020 10:40
    */
    DataResult upload(MultipartFile file);

    /**
    * 龙头企业导入
    * @author Sunke
    * @param [name, code]
    * @return boolean
    * @exception
    * @date 2020/10/20 0020 17:09
    */
    boolean checkForDuplicates(String name,String code);



}

